#define _CRT_SECURE_NO_WARNINGS 1

bool canConstruct(char* ransomNote, char* magazine) {
    int arr[26] = { 0 };
    for (int i = 0; magazine[i] != '\0'; i++)
    {
        arr[magazine[i] - 97]++;
    }
    for (int i = 0; ransomNote[i] != '\0'; i++)
    {
        if (!arr[ransomNote[i] - 97]--)
        {
            return false;
        }
    }

    return true;
}